package org.deschutter.exceptions;

import java.math.BigDecimal;

/**
 * User: Berten De Schutter
 * Date: 08-Jul-2009
 * Time: 17:32:00
 */
public class AddDevelopmentException extends Exception{

    String mistake;
    String x,y,z,scanID;
    BigDecimal tick;

    public AddDevelopmentException() {
        super();             // call superclass constructor
        mistake = "unknown";
    }


    public AddDevelopmentException(String err) {
        super(err);     // call super class constructor
        mistake = err;  // save message
    }

      public AddDevelopmentException(String err,String scanID,String x,String y,String z, BigDecimal tick) {
        super(err);     // call super class constructor
        mistake = err;  // save message
          this.scanID = scanID;
          this.x=x;
          this.y=y;
          this.z=z;
          this.tick = tick;
    }


    public String getError() {
        if(x == null) {
        return mistake;
        } else {
            return "[ADD DEVELOPMENT EXCEPTION] ScanID: " + scanID + ". Planet: " + x + ":" + y + ":" + z + ". Tick: " + tick + " Reason: " + mistake;
        }
    }
}
